package com.adteam.xmap.web;

import com.adteam.xmap.entity.Administrator;
import com.adteam.xmap.manager.AdministratorManager;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{
	
	private static final long serialVersionUID = 1L;

	private String account;
	
	private String password;
	
	private AdministratorManager administratorManager;
	
	public String login() {
		Administrator administrator = administratorManager.login(account, password);
		ActionContext.getContext().getSession().put("login", administrator);
		return "SUCCESS";
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setAdministratorManager(AdministratorManager administratorManager) {
		this.administratorManager = administratorManager;
	}
	
}
